home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1998 March / Software of the Month Club 1998 March.iso / pc / dos / lg / astreg / drivers.exe / POSTSCRI.PRG < prev    next >
Text File  |  1994-08-13  |  6KB  |  117 lines

  1. FUNCTION postscri
  2. PARAMETERS pc_todo,px_param1,px_param2,px_param3,px_param4,px_param5,px_param6,px_param7
  3.  
  4.    PRIVATE lc_params,lc_str,ll_query,ll_toprint
  5.    lc_params = "pc_todo,px_param1,px_param2,px_param3,px_param4,px_param5,px_param6,px_param7"
  6.  
  7.    lc_str     = ""
  8.    ll_query   = .F.
  9.    ll_toprint = .T.
  10.    pc_todo    = UPPER(pc_todo)
  11.    IF pc_todo="QUERY"
  12.       ll_query   = .T.
  13.       ll_toprint = .F.
  14.       IF PCOUNT()=1
  15.          RETURN .T.
  16.       ENDIF
  17.       pc_todo   = UPPER(px_param1)
  18.       px_param1 = px_param2
  19.       px_param2 = px_param3
  20.       px_param3 = px_param4
  21.       px_param4 = px_param5
  22.       px_param5 = px_param6
  23.       px_param6 = px_param7
  24.    ENDIF
  25.  
  26.    DO CASE                                                       
  27.       CASE pc_todo = "VMI"                                       
  28.            lc_str = "/LPI "+;                                    
  29.                     LTRIM(STR(1440/px_param1,10,4))+" def "      
  30.                                                                  
  31.       CASE pc_todo = "ORIENTATION"                               
  32.            PRIVATE la_orients,ln_x                               
  33.            DECLARE la_orients[3,2]                               
  34.                                                                  
  35.            la_orients[1,1] = "PORTRAIT"                          
  36.            la_orients[1,2] = "Port"                              
  37.            la_orients[2,1] = "LANDSCAPE"                         
  38.            la_orients[2,2] = "Land"                              
  39.                                                                  
  40.            ln_x = 1                                              
  41.            px_param1 = UPPER(px_param1)                          
  42.            DO WHILE TYPE("la_orients[ln_x,1]")='C'               
  43.               IF la_orients[ln_x,1] = px_param1                  
  44.                  EXIT                                            
  45.               ENDIF                                              
  46.               ln_x = ln_x + 1                                    
  47.            ENDDO                                                 
  48.                                                                  
  49.            IF TYPE("la_orients[ln_x,1]") = 'C'                   
  50.               lc_str = la_orients[ln_x,2]+" "                    
  51.            ENDIF                                                 
  52.                                                                  
  53.       CASE pc_todo = "PSIZE"                                     
  54.            PRIVATE la_psizes,ln_x                                
  55.            DECLARE la_psizes[5,2]                                
  56.                                                                  
  57.            la_psizes[1,1] = "LETTER"                             
  58.            la_psizes[1,2] = "letter"                             
  59.            la_psizes[2,1] = "LEGAL"                              
  60.            la_psizes[2,2] = "legal"                              
  61.            la_psizes[3,1] = "A4"                                 
  62.            la_psizes[3,2] = "a4"                                 
  63.            la_psizes[4,1] = "B5"                                 
  64.            la_psizes[4,2] = "b5"                                 
  65.                                                                  
  66.            ln_x = 1                                              
  67.            px_param1 = UPPER(px_param1)                          
  68.            DO WHILE TYPE("la_psizes[ln_x,1]")='C'                
  69.               IF la_psizes[ln_x,1] = px_param1                   
  70.                  EXIT                                            
  71.               ENDIF                                              
  72.               ln_x = ln_x + 1                                    
  73.            ENDDO                                                 
  74.                                                                  
  75.            IF TYPE("la_psizes[ln_x,1]") = 'C'                    
  76.               lc_str = la_psizes[ln_x,2]+" "                     
  77.            ENDIF                                                 
  78.                                                                  
  79.       CASE pc_todo = "TMARGIN"                                   
  80.            PRIVATE lc_tmargin,lc_textlen                         
  81.                                                                  
  82.            lc_tmargin = LTRIM(STR(px_param1/20))                 
  83.            lc_textlen = LTRIM(STR(_plength/6+;                   
  84.                  IIF(_psize="A4",7,;                             
  85.                  IIF(_psize="B5",35,0))/300,10,4))               
  86.                                                                  
  87.            lc_str =          "/tpyoff "+lc_tmargin+ " def "      
  88.            lc_str = lc_str + "/gpyoff "+lc_tmargin+ " def "      
  89.            lc_str = lc_str + "/apyoff "+lc_tmargin+ " def "      
  90.            lc_str = lc_str + "/PageHeight "+lc_textlen+" def "   
  91.            lc_str = lc_str + "Home "                             
  92.                                                                  
  93.     ENDCASE                                                      
  94.                                                                  
  95.                                                                  
  96.                                                                  
  97.                                                                  
  98.                                                                  
  99.                                                                  
  100.  
  101.     IF ll_toprint
  102.        ??? lc_str
  103.     ELSE
  104.       IF ll_query
  105.          px_param7 = px_param6
  106.          px_param6 = px_param5
  107.          px_param5 = px_param4
  108.          px_param4 = px_param3
  109.          px_param3 = px_param2
  110.          px_param2 = px_param1
  111.       ENDIF
  112.     ENDIF
  113.  
  114. RETURN .NOT. ISBLANK(lc_str)
  115.  
  116.                                                                  
  117.